/*
 * ImportadorArquivo.java
 *
 * Created on 12 de Julho de 2007, 15:22
 */

package br.com.cpqd.ssar.posprocessamento;

import java.io.File;
import java.util.Vector;
import javax.swing.JFileChooser;
import javax.swing.JFrame;

/**
 *
 * @author  acer
 */
public class SalvarArquivo extends javax.swing.JFrame {
    

    private File sf;
   
    private int[] configMalha;
    private String diretorio;
    
    
    /** Creates new form ImportadorArquivo */
    public SalvarArquivo() {
        initComponents();
        int option = jFileChooser1.showOpenDialog(new JFrame());
        // User selected OPEN
	if(option == JFileChooser.APPROVE_OPTION){
            // sf is an string that indicate the selected file
            sf = jFileChooser1.getSelectedFile();
            diretorio = new String(jFileChooser1.getCurrentDirectory().toString());
         

	}
      
        else if(option == JFileChooser.CANCEL_OPTION){
        }
    }
    
   
    
    
    
        
    public String getName(){
        try{
            return sf.getName();
        }catch(Exception e){
            System.out.println("Exception: " + e);
            return null;
        }
    }
    
    public String getDiretorio(){
        return  diretorio;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" C�digo Gerado ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jFileChooser1 = new javax.swing.JFileChooser();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jFileChooser1.setDialogTitle("P\u00f3s-visualiza\u00e7\u00e3o");
        jFileChooser1.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);
        jFileChooser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileChooser1ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jFileChooser1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jFileChooser1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser1ActionPerformed
// TODO adicione seu c�digo de manipula��o aqui:
    }//GEN-LAST:event_jFileChooser1ActionPerformed

    
    // Declara��o de vari�veis - n�o modifique//GEN-BEGIN:variables
    private javax.swing.JFileChooser jFileChooser1;
    // Fim da declara��o de vari�veis//GEN-END:variables
    
}
